<template>
  <div class="boss">
    <!-- 版心区域 -->
    <div class="center area-center">
      <!-- 访谈和电视总区域 -->
      <head-page title="访 谈" id="back"></head-page>
      <div class="top">
        <!-- 文字区域 -->

        <div
          class="wen title_word m-t-07"
          v-for="(item, index) in list"
          :key="index"
          @click="medium(item, index)"
        >
          <div class="left">
            <div
              class="yuan"
              :class="['zhong', index == curr ? 'backactive' : '']"
            ></div>
          </div>
          <div class="le" :class="['le', index == curr ? 'active' : '']">
            {{ item.interviewtypeName }}
          </div>
        </div>
      </div>
      <!-- 底部区域 -->
      <div class="bottom m-t-20">
        <div v-if="typeId != '56d45c53-a726-464e-a1b9-40fb2421edbd'">
          <div
            class="small title-center m-t-07"
            v-for="(item, index) in title"
            :key="index"
            @click="interdetail(item)"
          >
            <div class="num">{{ index + 1 }}.</div>
            <div class="right">
              {{ item.interviewTitle }}
            </div>
          </div>
        </div>
        <div v-else class="tv-group">
          <div
            class="tv-item"
            v-for="(item, index) in title"
            :key="index"
            @click="interdetail(item)"
          >
            <div class="title_word">
              {{ index + 1 }}.{{ item.interviewTitle }}
            </div>
            <div class="rel m-t-10 img-box">
              <div class="mask fcc">
                <van-icon name="play-circle-o" size="42" color="#fff" />
              </div>
              <img :src="imgurl + item.interviewImage" alt="" />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { interviewTypeNam, interviewType } from "@/api/index";
export default {
  data() {
    return {
      list: [],
      curr: 0,
      title: [],
      typeId: "",
    };
  },
  mounted() {
    //查看访谈类型(媒体和电视)
    interviewTypeNam().then((res) => {
      if (res.data.code == 200) {
        this.list = res.data.data;
        this.medium(this.list[0]);
      }
    });
    //访谈(电视)的标题
    // interviewType(this.num1).then((res) => {
    // 	// console.log(res);
    // 	if (res.data.code == 200) {
    // 		this.title = res.data.rows
    // 		// console.log(res.data.rows);
    // 	}
    // })
  },
  methods: {
    //跳转到媒体页面
    medium(item, index = 0) {
      this.curr = index;
      this.typeId = item.interviewtypeId;
      interviewType({
        id: item.interviewtypeId,
      }).then((res) => {
        if (res.data.code == 200) {
          this.title = res.data.data;
        }
      });
    },
    //访谈跳详情
    interdetail(item) {
      this.$router.push({
        path: "/intertwo/interdetail",
        query: {
          id: item.interviewId,
          type: this.typeId,
        },
      });
    },
    // 返回
    back() {
      this.$router.go("-1");
    },
  },
};
</script>

<style scoped>
/* 整体区域 */
.boss {
  width: 100%;
  display: flex;
  justify-content: center;
}
/* 下划线的设置 */

/* 访谈和电视总区域 */
.top {
  width: 100%;
  min-height: 0.6rem;
}
.wen {
  width: 100%;
  /* height: 50%; */
  display: flex;
}
.icon {
  width: 100%;
  height: 0.3rem;
  display: flex;
  align-items: center;
}
.tu img {
  width: 0.11rem;
  padding-top: 0.04rem;
}
.xiao .left {
  width: 5%;
  height: 0.3rem;
}
.yuan {
  width: 0.18rem;
  height: 0.18rem;
  border-radius: 50%;
  background-color: black;
  margin-top: 0.06rem;
}
.title {
  width: 100%;
  text-align: center;
  line-height: 0.3rem;
  font-weight: 700;
  font-size: 0.22rem;
}
.le {
  width: 93%;
  height: 100%;
  padding-left: 0.05rem;
}
.ri {
  width: 7%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.ri img {
  width: 0.2rem;
  height: 0.24rem;
}
/* 底部区域 */
.bottom {
  width: 100%;

}
.small {
  width: 100%;
  min-height: 0.2rem;
  display: flex;
}
/* 原点区域 */
.left {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 内容区域 */
.right {
  width: 94%;
  height: 100%;
  padding-left: 0.05rem;
}
.tv-group {
  width: 100%;
  padding: 1.5%;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
}
.tv-item {
  width: 47%;
  padding: 1.5%;
  display: inline-block;
}
.tv-item img {
  width: 100%;
  height: 2rem;
}
.tv-item .mask {
  width: 100%;
  height: 2rem;
  background: rgba(0, 0, 0, 0.4);
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
}
.img-box {
  width: 100%;
  height: 2rem;
  border: 1px solid #eee;
}
</style>